home *** CD-ROM | disk | FTP | other *** search
/ Trouble & Attitude 4 / Trouble and Attitude - Issue 04.iso / mac / DATA / MOVIES / JULIE.Dxr / 00021_Text_Template Scripts.txt < prev    next >
Text File  |  1997-01-30  |  22KB  |  840 lines

  1. -- During Video 
  2. on exitFrame
  3.   if soundbusy (1) then sound stop 1
  4.   if soundbusy (2) then sound stop 2
  5.   rollme
  6.   MovieStatus
  7.   if the movietime of sprite 2 < the stopTime of sprite 2 then
  8.     go to the frame
  9.   else
  10.     puppetsprite 30, false
  11.     puppetsprite 37, false
  12.     go to "wait"
  13.   end if
  14. end
  15.  
  16.  
  17.  
  18. -- Before Video 1
  19. on exitframe
  20.   QTSound
  21. end
  22.  
  23. -- Before Video 2
  24. on enterFrame
  25.   global gThisMovie
  26.   puppetsprite 30, true
  27.   set the directToStage of cast the castnum of sprite 2 to true
  28.   set the controller of cast the castnum of sprite 2 to false
  29.   if the movierate of sprite 2 <> 1 then set the movierate of sprite 2 to 1
  30.   updatestage
  31. end
  32.  
  33.  
  34. -- WAIT 
  35. on exitFrame
  36.   keepmusic
  37.   go to the frame
  38. end
  39.  
  40.  
  41. -- On Video
  42.  
  43. on mouseUp
  44.   if the OPTIONdown then
  45.     if the controller of cast the castnum of sprite 2 = true then
  46.       set the controller of cast the castnum of sprite 2 to false
  47.     else
  48.       set the controller of cast the castnum of sprite 2 to true
  49.     end if
  50.   else
  51.     set the controller of cast the castnum of sprite 2 to false
  52.     puppetsprite 2, false
  53.     puppetsprite 4, false
  54.     puppetsprite 30, false
  55.    pause
  56.   end if
  57. end 
  58.  
  59. -- ???
  60.  
  61. on exitFrame
  62.   cursor -1
  63.   keepmusic
  64.   go to the frame
  65. end
  66.  
  67.  
  68. -- CAPTIONS
  69. on mouseDown
  70.   global gShowCaptions
  71.   
  72.   set gShowCaptions = not gShowCaptions
  73.   
  74.   if gShowCaptions then
  75.     set the CastNum of sprite 47 = 407
  76.   else
  77.     set the CastNum of sprite 47 = 427
  78.   end if
  79.   upDateStage
  80.   if the doubleClick then startback
  81. end
  82.  
  83.  
  84.  
  85. ---- MAIN ------
  86.  
  87. on Time
  88.   nothing
  89. end
  90.  
  91. on startmovie
  92.   set the preloadeventabort = true
  93.   set the exitlock to true
  94.   if (the commandDown) and (the key = "q") then quitme
  95.   if (the commandDown) and (the key = ".") then quitme
  96.   if (the optionDown) and (the key = "i") then Beep
  97.   if (the optionDown) and (the ControlDown) and (the CommandDown) and ┬¼
  98.                           (the ShiftDown) and (the key = "b") then alert "hi"
  99.   global gCurPath, gIconText,gStText,gEnText,gTextOn,gMusicType,gShowCaptions,gMusicOn
  100.   global gOldVol,gMuteSound,gSoundLevel,MouseNow,ScreenSaverWait,gIconText,gStText,gEnText
  101.   set the mouseDownScript to "mouseNoises"
  102.   set the mouseUpScript to "MouseUpClick"
  103.   set gStText = 10
  104.   set gEnText = 10
  105.   Put [".",".","."] into gIconText
  106.   set mouseNow = 0
  107.   set the volume of sound 2 = gSoundLevel
  108.   set the volume of sprite 2 = gSoundLevel
  109.   -- sets music icon
  110.   if gMusicOn then
  111.     set the castnum of sprite 46 to 406
  112.   else
  113.     set the castnum of sprite 46 to 426
  114.   end if
  115.   -- Turns off music description
  116.   set the visible of sprite 38 to false
  117.   if gShowCaptions then
  118.     set the castnum of sprite 47 to 407
  119.   else
  120.     set the castnum of sprite 47 to 427
  121.   end if
  122.   
  123.   -- set gSoundLevel = the volume of sound 2
  124.   set gTextOn to true
  125.   set gMusicType = 5
  126.   if the colorDepth = 8 then
  127.     set the foreColor of cast "icontext" to 5
  128.   else if the colordepth = 16 then
  129.     set the foreColor of cast "icontext" to 992
  130.   else if the colordepth = 32 then
  131.     set the foreColor of cast "icontext" to 65280
  132.   end if
  133.   put "." into field "IconText"
  134.   puppetTempo 60
  135.   if not gMuteSound and the soundLevel = 0 then
  136.     set the soundLevel = gOldVol
  137.   else if gMuteSound then
  138.     set the soundLevel = 0
  139.     set the castNum of sprite 46 = 426
  140.   end if
  141.   
  142.   if voidp(gSoundLevel) then
  143.     put 200 into gSoundLevel
  144.     set the volume of sprite 1 = gSoundLevel
  145.   end if
  146.   
  147.   puppetSprite 42,FALSE
  148.   set the visible of sprite 42 = FALSE
  149.   repeat with i = 39 to 41
  150.     puppetSprite i,TRUE
  151.     set the visible of sprite i to TRUE
  152.   end repeat
  153.   repeat with i = 43 to 47
  154.     puppetSprite i,TRUE
  155.     set the visible of sprite i to TRUE
  156.   end repeat
  157.   set the updateMovieEnabled = TRUE
  158.   if the movie = "INDEX" then -- parameters for contents **IB
  159.     keepmusic
  160.     repeat with i = 2 to 8 
  161.       set the visible of sprite i to FALSE
  162.     end repeat
  163.     repeat with i = 29 to 38
  164.       set the visible of sprite i to FALSE
  165.     end repeat
  166.   end if
  167.   
  168.   -- Set Cursors
  169.   --set the cursor of sprite 5 to [459,460] --next picture
  170.   --set the cursor of sprite 6 to [457,458] --Pre picture
  171.   --set the cursor of sprite 31 to [453,454] --scroll up
  172.   --set the cursor of sprite 32 to [455,456] --scroll down
  173.   --set the cursor of sprite 37 to [461,462] --return
  174.   
  175.   set the timeoutLength to (60 * 60) * 10 -- ScreenSaverWait
  176.   set the timeoutPlay to true
  177.   set the timeoutScript to "screensaverOn"
  178. end
  179.  
  180. on idle
  181.   set the keyDownScript to "doCommandKey"
  182.   memcheck
  183.   updatestage
  184. end
  185.  
  186. on screenSaverOn
  187.   put the mouseV into screenSaverMouse
  188.   global gCastNumTemp,glochTemp,glocvTemp,gforecolorTemp,gScreenSaver,g47width,g47height,gink
  189.   put [212,213,214,215,216,217,218,219,220,219,218,217,216,215,214,213] into ColorList --16
  190.   set gScreenSaver = true
  191.   put the ink of sprite 47 into gink
  192.   put the castNum of sprite 47 into gCastNumTemp
  193.   put the loch of sprite 47 into glochTemp
  194.   put the locv of sprite 47 into glocvTemp
  195.   put the forecolor of sprite 47 into gforecolorTemp
  196.   -- puppetsprite 47, true
  197.   set the castnum of sprite 47 = 350
  198.   set the trails of sprite 47 = true
  199.   set the loch of sprite 47 = 0
  200.   set the locv of sprite 47 = 0
  201.   set the width of sprite 47 = 5
  202.   set the height of sprite 47 = random(10)
  203.   set the forecolor of sprite 47 = 4
  204.   set the ink of sprite 47 to 0 --39 33 34 37 38
  205.   set hOffSet = random(8) -- 1
  206.   set VoffSet = random(8) -- 1
  207.   if hOffset = 0 and vOffset = 0 then set vOffset = random(8)
  208.   set r = 1
  209.   set z = 4
  210.   set y = 4
  211.   set n = 1
  212.   -- repeat while n < 4000
  213.   repeat while screenSaverMouse = the mousev
  214.     set n = n + 1
  215.     set i = i + 1
  216.     set z = z + 1
  217.     set y = y + 1
  218.     if y = 9 then set y = 1
  219.     if z = 7 then set z = 1
  220.     if i > 16 then set i = 1
  221.     set the forecolor of sprite 47 = getAt (colorlist,i)
  222.     if the loch of sprite 47 > 640 then set hOffSet = random(8) - 9
  223.     if the locv of sprite 47 > 480 then set vOffSet = random(8) - 9
  224.     if the loch of sprite 47 < 0 then set hOffSet = random(8) - 1
  225.     if the locv of sprite 47 < 0 then set vOffSet = random(8) - 1
  226.     set the width of sprite 47 = z
  227.     if n > 1000 then set the height of sprite 47 = random (20)
  228.     else if n > 1000 then set the height of sprite 47 = random (40)
  229.     else if n > 3000 then set the height of sprite 47 = random (80)
  230.     if n > 2000 then set the ink of sprite 47 to 33
  231.     if n > 4000 then set the ink of sprite 47 to 37
  232.     if n > 5000 then set the ink of sprite 47 to 39
  233.     set the loch of sprite 47 = the loch of sprite 47 + hOffSet
  234.     set the locv of sprite 47 = the locv of sprite 47 + vOffSet
  235.     if n > 20000 then
  236.       set r = r + 1
  237.       set n = 1
  238.     end if
  239.     if r = 2 then
  240.       -- if the ink of sprite 47 > 39 then set the ink of sprite 47 to 0
  241.       -- set the ink of sprite 47 to the ink of sprite 47 + 1
  242.     end if
  243.     updatestage
  244.     if the mousedown then exit repeat
  245.     keepmusic
  246.   end repeat
  247.   ScreenSaverOff
  248. end
  249.  
  250. on ScreenSaverOff
  251.   global gCastNumTemp,glochTemp,glocvTemp,gforecolorTemp,gScreenSaver,g47width,g47height,gink
  252.   set the trails of sprite 47 = false
  253.   set gScreenSaver = false
  254.   set the castNum of sprite 47 to gCastNumTemp
  255.   set the loch of sprite 47 to glochTemp
  256.   set the locv of sprite 47 to glocvTemp
  257.   set the forecolor of sprite 47 to gforecolorTemp
  258.   set the width of sprite 47 = g47width
  259.   set the height of sprite 47 = g47height
  260.   set the ink of sprite 47 to gink
  261.   puppetTransition 2, 1, 50, FALSE
  262. end
  263.  
  264. on rollme
  265.   global gShowIcons, gSongName 
  266.   global gIconRoll
  267.   global gTextActive
  268.   global gShowCaptions
  269.   global gMuteSound
  270.   -- normalize all buttons
  271.   repeat with roll = 39 to 41
  272.     if rollover(roll) then
  273.       exit repeat
  274.     else
  275.       set the castNum of sprite roll = roll+361
  276.       upDateStage
  277.     end if
  278.   end repeat
  279.   repeat with roll = 43 to 45
  280.     if rollover(roll) then
  281.       exit repeat
  282.     else
  283.       set the castNum of sprite roll = roll+360
  284.       upDateStage
  285.     end if
  286.   end repeat
  287.   set the visible of sprite 42 to FALSE
  288.   -- switch buttons on rollover
  289.   repeat with roll = 39 to 41
  290.     if rollover(roll) then
  291.       if gShowCaptions and the castNum of sprite roll = roll+361 then
  292.         set the castNum of sprite roll = the castNum of sprite roll + 30
  293.         upDateStage
  294.         exit repeat
  295.       else if the castNum of sprite roll = roll+361 then
  296.         set the castNum of sprite roll = the castNum of sprite roll + 10
  297.         upDateStage
  298.         exit repeat
  299.       end if
  300.     end if  
  301.   end repeat
  302.   repeat with roll = 43 to 45
  303.     if rollover(roll) then
  304.       if gShowCaptions and the castNum of sprite roll = roll+360 then 
  305.         set the castNum of sprite roll = the castNum of sprite roll + 30
  306.         upDateStage
  307.         exit repeat
  308.       else if the castNum of sprite roll = roll+360 then
  309.         set the castNum of sprite roll = the castNum of sprite roll + 10
  310.         upDateStage
  311.         exit repeat
  312.       end if
  313.     end if  
  314.   end repeat
  315.   if rollover(42) then
  316.     set the visible of sprite 42 to TRUE
  317.   end if
  318.   iconText  
  319. end
  320.  
  321.  
  322. on icontext
  323.   global gIconText, gStText, gEnText, gTextOn, gShowCaptions, gPointer,gMusicOn
  324.   put TRUE into CLEARIT
  325.   set the visible of sprite 48 to TRUE
  326.   if voidP(gStText) or voidP(gEnText) then
  327.     put 1 into gStText 
  328.     put 1 into gEnText
  329.     put ["","",""] into gIconText
  330.   end if
  331.   if the colorDepth = 8 then
  332.     set the foreColor of cast "icontext" to 5
  333.   else if the colordepth = 16 then
  334.     set the foreColor of cast "icontext" to 992
  335.   else if the colordepth = 32 then
  336.     set the foreColor of cast "icontext" to 65280
  337.   end if
  338.   repeat with i = gStText to gEnText
  339.     if rollover (i) then
  340.       put FALSE into CLEARIT
  341.       put i-(gStText-1) into pos
  342.       if gShowCaptions then
  343.         put getAt(gIconText,pos) into field "IconText"
  344.       end if
  345.       cursor [455,456]
  346.       exit repeat
  347.     end if
  348.     put TRUE into CLEARIT
  349.   end repeat 
  350.   if CLEARIT then
  351.     put "" into field "IconText"
  352.     cursor -1
  353.   end if
  354.   if gShowCaptions then
  355.     if gMusicOn then
  356.       if rollover(45) then
  357.         set the visible of sprite 38 to true
  358.       else
  359.         set the visible of sprite 38 to false
  360.       end if
  361.     else
  362.       set the visible of sprite 38 to false
  363.     end if
  364.   end if
  365. end
  366.  
  367. on quitme
  368.   global gTheFrame,gTheMovie
  369.   put the frame into gTheFrame
  370.   put the movie into gTheMovie
  371.   -- size of quit window = z320 x 100
  372.   set the rect of window "quit" to rect(the stageleft + 184, the stagetop + 166, the stageleft + 320 + 184, the  stagetop + 100 + 166)
  373.   Set the windowType of window "Quit" to 2
  374.   Open Window "Quit"
  375. end
  376.  
  377. on QTSound
  378.   if the machinetype = 256 then
  379.     sound stop 1
  380.     sound stop 2
  381.   else
  382.     sound fadeout 1, 60
  383.     sound fadeout 2, 60
  384.   end if
  385. end QTSound
  386.  
  387. on memcheck
  388.   global gRamNow
  389.   set gRamNow = the FreeBytes
  390.   if the freeBytes < (1000 * 1024) then UnLoadCast
  391. end
  392.  
  393. on playmusic
  394.   global gMusicOn
  395.   sound stop 2
  396.   if gMusicOn then playme
  397. end Playmusic
  398.  
  399. on PLAYME
  400.   global ipath, gcurpath, gMusicType, gRandMus, gOldTime, gNowPlaying,RandNumMusic,gMusicOn
  401.   
  402.   set RandNumMusic = RandNumMusic + 1
  403.   if RandNumMusic > 13 then set RandNumMusic = 1
  404.   set PlayThis = gcurpath & "Data:Decibels:Coolio:003.AIF"
  405.   
  406.   sound playfile 2, playthis
  407.   put getAt (gMusicList,RandNumMusic) into gNowPlaying
  408.   
  409.   if gMusicOn then
  410.     put "Now Playing:" & gNowPlaying into field "Now Playing" --& RandNumMusic 
  411.   else
  412.     put "The Background Music is Turned Off" into field "Now Playing"
  413.   end if
  414.   
  415. end
  416.  
  417. on PLAYME2
  418.   global ipath, gcurpath, gMusicType, gRandMus, gOldTime, gNowPlaying,RandNumMusic,gMusicOn
  419.   
  420.   
  421.   set PlayThis = gcurpath & "Data:Decibels:Henley:" & RandNumMusic & ".AIF"
  422.   
  423.   
  424.   sound playfile 2, playthis
  425.   puppetsprite 31, true
  426.   set the loch of sprite 31 = 299
  427.   set the locv of sprite 31 = (50+(RandNumMusic*13))
  428.   put getAt (gMusicList,RandNumMusic) into gNowPlaying
  429.   
  430.   updateStage
  431.   go to the frame
  432.   keepmusic
  433.   
  434.   set RandNumMusic = RandNumMusic + 1
  435.   if RandNumMusic > 13 then set RandNumMusic to 1
  436.   
  437.   
  438. on StopMovie
  439.   if the colorDepth = 8 then
  440.     set the foreColor of cast "icontext" to 5
  441.   else if the colordepth = 16 then
  442.     set the foreColor of cast "icontext" to 992
  443.   else if the colordepth = 32 then
  444.     set the foreColor of cast "icontext" to 65280 -- 391
  445.   end if
  446.   put "Loading . . ." into field "icontext"
  447.   Set gPointer to false
  448. end
  449.  
  450. on helpme
  451.   global gTheFrame
  452.   global gTheMovie
  453.   if The Movie = "HELP" then
  454.     go to movie "index"
  455.     put "index" into gTheMovie
  456.   else
  457.     put the frame into gTheFrame
  458.     put the movie into gTheMovie
  459.     go to movie "HELP"
  460.   end if
  461. end
  462.  
  463. on keepMusic
  464.   if soundbusy(1) or soundbusy(2) then
  465.     nothing
  466.   else 
  467.     playmusic
  468.   end if
  469. end
  470.  
  471. on keepMusic2
  472.   if soundbusy(1) or soundbusy(2) then
  473.     nothing
  474.   else 
  475.     playmusic2
  476.   end if
  477. end keepMusic2
  478.  
  479. on playMusic2
  480.   global gMusicOn
  481.   sound stop 2
  482.   if gMusicOn then playme2
  483. end if
  484. end playMusic2
  485.  
  486. on closeWindow
  487. put the pathname & the movie into tWindow
  488. tell the stage to closeMovie tWindow
  489. end
  490.  
  491. on closeMovie theWindow
  492. forget window theWindow
  493. end
  494.  
  495. on printPage
  496. printFrom the frame, the frame
  497. end
  498.  
  499. on stepMovie
  500.         doCommandKey
  501. end stepMovie
  502.  
  503. on doCommandKey
  504. global gMusicOn
  505. if (the commandDown) then 
  506. if (the key = "q") then quitme
  507. else if (the key = ".") then quitme
  508. else if (the key = "d") then go to movie "Desktop"
  509. else if (the key = "h") then helpme
  510. else if (the key = "i") then go to movie "index"
  511. else if (the key = "k") then Startback
  512. else if (the key = "p") then printPage
  513. else if (the key = "c") then copyScreenRegion
  514. else if (the key = "m") then
  515. if gMusicOn = true then put false into gMusicOn
  516. else
  517. put true into gMusicOn
  518. end if
  519. end if
  520. end if  
  521. doControlKey
  522. end
  523.  
  524. on doControlKey
  525. global gMusicOn
  526. if (the controlDown) then 
  527. if (the key = "q") then quitme
  528. else if (the key = ".") then quitme
  529. else if (the key = "d") then go to movie "Desktop"
  530. else if (the key = "h") then helpme
  531. else if (the key = "i") then go to movie "index"
  532. else if (the key = "k") then Startback
  533. else if (the key = "p") then printPage
  534. else if (the key = "c") then copyScreenRegion
  535. else if (the key = "m") then
  536. if gMusicOn = true then
  537. put false into gMusicOn
  538. sound stop 2
  539. else
  540. put true into gMusicOn
  541. end if
  542. end if
  543. end if
  544. end
  545.  
  546. On Startback
  547. global gCurPath
  548. if the machinetype = 256 then
  549. nothing
  550. else
  551. global gWinObj, gCurPath
  552. openXLib gCurPath & "DATA:OBJEX:BACKER.XBJ"
  553. if ObjectP(gWinObj) then
  554. gWinObj (mDispose)
  555. else
  556. global gWinObj
  557. set gwinobj = rearwindow (mNew,"M")
  558. gWinObj(mIndexColorToWindow, 255)
  559. -- CloseXLib "Night on EarthNight on Earth:ATTITUDE:DATA:OBJEX:BACKER.XBJ"
  560. end if
  561. end if
  562. end
  563.  
  564. on killback
  565. global gCurPath
  566. if the machinetype = 256 then
  567. nothing
  568. else
  569. global gWinObj
  570. If ObjectP (gWinObj) then
  571. gWinObj (mDispose)
  572. -- CloseXLib gCurPath & "DATA:OBJEX:BACKER.XBJ"
  573. end if
  574. end if
  575. end
  576.  
  577. on PreviewPICT
  578. set PICTfile = FileIO(mNew, "?read", "PICT")
  579. if not objectp(PICTfile) then exit
  580. set the picture of cast 349 = PICTfile(mReadPICT)
  581. PICTfile(mDispose)
  582. end PreviewPICT
  583.  
  584. on PreviewAccel
  585. set Accelfile = FileIO(mNew, "?read", "VWC0")
  586. if not objectp(Accelfile) then exit
  587. playAccel (Accelfile(mFileName))
  588. Accelfile(mDispose)
  589. end PreviewAccel
  590.  
  591. on PreviewAIFF
  592. set AIFFfile = FileIO(mNew, "?read", "AIFF")
  593. if not objectp(AIFFfile) then exit
  594. sound playFile 2, (AIFFfile(mFileName))
  595. AIFFfile(mDispose)
  596. end PreviewAIFF
  597.  
  598. on RestoreScreen
  599. set the picture of cast "PICTCast" to the picture of cast "NullCast"
  600. end RestoreScreen
  601.  
  602. on startMovie2
  603. if the machinetype <> 256 then
  604. global copyObj, savePicHandle, gCurPath, pictureFlag
  605. openXLib gCurPath & "DATA:OBJEX:STAGEPIC.XBJ"
  606. if objectP( copyObj ) then copyObj( mDispose )
  607. put StageToPICT( mNew ) into copyObj
  608. end if
  609. end startMovie2
  610.  
  611. on copyScreenRegion
  612. if the machinetype <> 256 then
  613. global copyObj, pictureFlag, gCopytime
  614. put integer( value( field "regionTop"    ) ) into rT
  615. put integer( value( field "regionLeft"   ) ) into rL
  616. put integer( value( field "regionBottom" ) ) into rB
  617. put integer( value( field "regionRight"  ) ) into rR
  618.  
  619. set errCode = copyObj( mSaveAsPICT, rT, rL, rB, rR, field "thispathname"┬¼
  620.     & ":" & field "filename" & gCopytime)
  621. -- ^ sets the path & filename
  622. put     " " into field "resultField"
  623. put errCode into field "resultField"
  624. if errCode = 0 then
  625. set gCopytime = gCopytime + 1
  626. put gcopytime into field "Number of Pictures"
  627. else
  628. if errCode = -35 then alert "Please type in another pathname." & " " ┬¼
  629.     & QUOTE & field "thispathname" & QUOTE
  630. else if errCode = -120 then alert "Please type in another pathname."┬¼
  631.     & "  " & QUOTE & field "thispathname" & QUOTE
  632. else
  633. if errCode = -48 then
  634. -- alert "Name Already Taken." & "  " & QUOTE & field "filename" & gCopytime & QUOTE
  635. set gCopytime = gCopytime + 1
  636. copyScreenRegion
  637. end if
  638. end if
  639. end if
  640. end if
  641. end
  642. --
  643. on stopMovie2
  644. if the machinetype <> 256 then
  645. global copyObj, pictureFlag
  646. -- reset the QuickTime movie to the beginning:
  647. -- set the movieTime of sprite 2 to 0
  648. updateStage
  649. put " " into field "resultField"
  650. -- clear the object from RAM:
  651. if objectP( copyObj ) then copyObj( mDispose )
  652. -- if the XObject is not embedded in this movie, we close
  653. -- the link to it this way:
  654. -- closeXLib gCurPath & "DATA:OBJEX:STAGEPIC.XBJ"
  655. end if
  656. end
  657. --
  658.  
  659. on MovieStatus
  660. set the width of sprite 30 = ((the movietime of sprite 2 * the width of sprite 29)/the duration of cast the castnum of sprite 2) - 2
  661. end
  662.  
  663. on SayIt theText
  664. if the machinetype <> 256 then
  665. global gSpeakObj
  666. if objectP( gSpeakObj ) then
  667. gSpeakObj( mSpeakText, theText )
  668. end if
  669. end if
  670. end SayIt
  671.  
  672. on numVoices
  673. -- Speak the number of voices installed on this machine
  674. global gSpeakObj
  675. if objectP( gSpeakObj ) then
  676. set num to gSpeakObj( mCountVoices )
  677. set theText to "There are "
  678. put string( num ) after theText
  679. put " voices installed on this Macintosh." after theText
  680. repeat while TRUE = gSpeakObj( mAreWeSpeaking )
  681. end repeat
  682. gSpeakObj( mSpeakText, theText )
  683. end if
  684. end numVoices
  685.  
  686. on NameAll
  687. -- Speak the names of all voices installed on this machine
  688. global gSpeakObj
  689. if objectP( gSpeakObj ) then
  690. gSpeakObj( mSpeakText, "Here is a list of all the voices on this Macintosh.")
  691. set max to gSpeakObj( mCountVoices )
  692. set i to 1
  693. repeat while i <= max
  694. set voiceName to gSpeakObj( mGetVoiceByIndex, i )
  695. put "  " after voiceName  -- put brief pause after each name
  696. repeat while TRUE = gSpeakObj( mAreWeSpeaking ) -- pause until done speaking
  697. end repeat
  698. gSpeakObj( mSpeakText, voiceName )
  699. set i to i + 1
  700. end repeat
  701. end if
  702. end NameAll
  703.  
  704. on waitTillDone
  705. global gSpeakObj
  706. repeat while TRUE = gSpeakObj( mAreWeSpeaking ) -- pause until done speaking
  707. end repeat
  708. end waitTillDone
  709.  
  710. -- **********************************
  711.  
  712. on helpTool
  713. open window "controls"
  714. end
  715.  
  716. on OpenMemory
  717. set theWindowTop = 0
  718. set theWindowLeft = 450
  719. set theWindowWidth = 130
  720. set theWindowHeight = 12
  721. set the rect of window "Control2" to rect(theWindowLeft + the stageleft,theWindowTop + the stagetop + theWindowTop, theWindowWidth + the stageleft + theWindowLeft, theWindowHeight + the stagetop)
  722. set the windowType of window "Control2" to 2
  723. open window "Control2"
  724. end
  725.  
  726. on OpenControl
  727. set theWindowTop = 0
  728. set theWindowLeft = 266
  729. set theWindowWidth = 150
  730. set theWindowHeight = 12
  731. set the rect of window "Controls" to rect(theWindowLeft + the stageleft,theWindowTop + the stagetop + theWindowTop, theWindowWidth + the stageleft + theWindowLeft, theWindowHeight + the stagetop)
  732. set the windowType of window "Controls" to 2
  733. open window "Controls"
  734. end
  735.  
  736. on MoveControl
  737. set theWindowTop = 0
  738. set theWindowLeft = 0
  739. set theWindowWidth = 160
  740. set theWindowHeight = 12
  741.  
  742. repeat while theWindowLeft < 640
  743. set theWindowLeft = theWindowLeft + 5
  744. set the rect of window "Control2" to rect(theWindowLeft + the stageleft,theWindowTop + the stagetop + theWindowTop, theWindowWidth + the stageleft + theWindowLeft, theWindowHeight + the stagetop)
  745. end repeat
  746. end
  747.  
  748. on pictPlus lowest, highest
  749. puppetsprite 4, true
  750. set the center of cast 4 to true
  751. if the castnum of sprite 4 < highest then
  752. set the castnum of sprite 4 to the castnum of sprite 4 + 1
  753. updatestage
  754. else
  755. set the castnum of sprite 4 to lowest
  756. updatestage
  757. end if
  758. preloadcast the castnum of sprite 4 - 3, the castnum of sprite 4 + 3
  759. end
  760.  
  761. on pictMinus lowest, highest
  762. puppetsprite 4, true
  763. if the castnum of sprite 4 > lowest then
  764. set the castnum of sprite 4 to the castnum of sprite 4 - 1
  765. updatestage
  766. else
  767. set the castnum of sprite 4 to highest
  768. updatestage
  769. end if
  770. preloadcast the castnum of sprite 4 - 3, the castnum of sprite 4 + 3
  771. end
  772.  
  773. on mouseNoises
  774. global mouseClickNoise
  775. set mouseClickNoise = true
  776. if the machinetype <> 256 then if mouseClickNoise = true then nothing --puppetsound "BEEP"
  777. updatestage
  778. set mouseClickNoise = false
  779. end
  780.  
  781.  
  782.  
  783. --------------
  784.  
  785.  
  786. -- Bg Music Off
  787.   on mouseDown
  788.   global gMusicOn
  789.   if gMusicOn then
  790.     set gMusicOn = False
  791.     if soundbusy(2) then sound stop 2
  792.    end if
  793.   upDateStage
  794. end    
  795.  
  796. on MouseUpClick
  797. updatestage
  798. end        
  799.  
  800.  
  801. -- Bg Music On
  802. on mouseDown
  803.   global gMusicOn
  804.   if gMusicOn = false then
  805.     set gMusicOn = true
  806.     keepmusic
  807.   end if
  808.   upDateStage
  809. end    
  810.  
  811. -- Change Music
  812. on mousedown
  813.   global gMusicOn
  814.   if not gMusicOn then
  815.     set gMusicOn to true
  816.   end if
  817.   pause
  818.   playMusic
  819. end
  820.     
  821.  
  822.  
  823. -- SOUND UP
  824. on mousedown
  825.   if the soundlevel < 7 then
  826.     set the soundlevel to the soundlevel + 1
  827.   end if
  828.   upDateStage
  829. end 
  830.  
  831.  
  832. -- Sound Down
  833. on mousedown
  834.   if the soundlevel > 0 then
  835.     set the soundlevel to the soundlevel - 1
  836.   end if
  837. end 
  838.  
  839.     
  840.